import React from "react";

export function getOptionSpan(courseTestChooseAnwser, size = 14) {
  // console.log('courseTestChooseAnwser',courseTestChooseAnwser)
  // console.log('size',size)
  return Math.max(...courseTestChooseAnwser.map(option => {
    let memo = option.memo
    if(/<img[^<>]+>/g.test(memo)){
      return 24
    }else{
      memo = memo.replace(/<[^<>]+>/g, '')
      return memo.length < size ? 6 : memo.length < size * 2 ? 12 : 24
    }
  }))
}
